-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the logic of NewVersionTest #19
base: master
Are you sure you want to change the base?
Conversation
* handling the new alert when creating a new version of an item that is in moderation * refactoring code to reduce duplicated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a few minor changes. 👍
itemList = adminPage.results(); | ||
// Login as SimpleModerator and moderate the new version of this item at the first step. | ||
logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD); | ||
doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, "moderation step 1", itemFullName2,false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe create a constant for "moderation step 1"
string, as it is used more than once. Probably step 2 as well, for consistency.
@TestInstitution("workflow") | ||
public class NewVersionTest extends AbstractCleanupTest | ||
{ | ||
private static final String BACKTICK_PASSWORD = "``````"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are all public static final String
, the whitespaces between each line should be removed.
WizardPageTab wizard = new ContributePage(context).load().openWizard("Move to Live During Moderation"); | ||
String itemFullName = context.getFullName("item"); | ||
String itemFullName2 = itemFullName + " 2"; | ||
wizard.editbox(1, itemFullName); | ||
wizard.save().submit(); | ||
saveItem(wizard,1,itemFullName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be space between the parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of tweaks, then we should be done. 👍
logout(); | ||
} | ||
|
||
private void doModeration(String username, String password, String stepName, String itemFullName, Boolean lastModeration) { | ||
TaskListPage taskListPage = new TaskListPage(context).load(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
username
and password
are unused. Remove.
// Login as SimpleModerator and moderate the new version of this item at the first step. | ||
logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD); | ||
doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, STEP_NAME_ONE, itemFullName2,false); | ||
// After moderation, check that the item has gone life after the first moderation step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
has gone
life
should be
has gone live
ModerationView tasksTab = modResults.moderate(itemFullName); | ||
tasksTab.assignToMe(); | ||
tasksTab.accept(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this if/else the braces should follow the statement.
Shame we don't have formatting here yet, but we will once we merge this repo in.
ce8d91b
to
e7d534d
Compare
handling the new alert when creating a new version of an
item that is in moderation
refactoring code to reduce duplicated code